import React, { Component } from 'react';
import SubjectList from 'components/subjectList/subjsctList'
import { getSubjectList } from 'api/weifeng'
import { get } from 'utils/http'

// import { Flex } from 'antd-mobile';
class subject extends Component {
    state={
        list:[]
    }
    constructor() {
        super();
    }

    async getSubjectList() {
        this.subject = await get({
            url: `http://h5test.wfdata.club/v1/topic/category`,
            headers: {
                'X-Request-Id': 'dgmxgkvRVZg+WaDX0YdMU6N6CO/H3U7PGly02rBHH2ZU6pldHMBk//l5L1Q+RDqF9MYuLFXxaPic0W60EC8gaA==',
                'X-Running-Env': 'Q3OVXEArMgZNlMHtAxpu7ONj6bFtJQXn/rvs04BOX697Tr585tFrKIfZg2KoeUpgvnQYU5SNJ6oll+TA3FcxhCSpa6SvJgmuq4xYqBNA20NJ8ldwleqG5XO+/pJxDWDxaNNMPz7ogAvZMCU05jjILfwfb4xVDID+l4bJCv3PvZscJDIQEUoUSJwLTyrr7tv+gqSf9UY9s9WYRpJ1JOgOJVE/R7GAEfmgKwxF17NRO5ggEi+HSU8VLk4VqV/x4hOj'
            }
        })

       this.setState({
            list:this.subject.data.dataList
       })
    }

    componentDidMount(){
        this.getSubjectList()
    }
 

    render() {
        // console.log(this.state.list)
        return (
            <div style={{
                height:'100%',
                position:'relative',
                display:'flex',
                flexDirection:'column',
                overflow:'scroll'
            }}>
                <SubjectList array={this.state.list}></SubjectList>
            </div>
        );
    }
}

export default subject;